home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 1
/
Pier Shareware 1.iso
/
035a
/
pocketd.exe
/
DEMO.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-03-09
|
13KB
|
410 lines
echo off
cls
d /Yny// /'//@tThis is a DEMO for &WPocketD&w. Do you want to proceed (Y@/N) ?'
if not errorlevel 2 goto fin
echo This demonstration will only show a very small sample of PocketD's features.
echo It will ignore all files other than the original PocketD release files.
echo PocketD's internal screen size is set to 80 cols by 11 rows for demonstration
echo purposes. ( THE MENUS BELOW ARE ALL DIRECTLY CONTROLLED BY PocketD ! ).
set d_opt2=/#80,11p:.d.exe/:.d.exe
goto main2
:main
cls
echo Returning to main menu..
:main2
d /Y_123456 /'//@t1. &RColour&w/@t2. DIR formats/@t3. Template/@t4. File info/@t5. File select/@t6. Help//@tESC exit//@t?'
if errorlevel 7 goto help
if errorlevel 6 goto select
if errorlevel 5 goto stats
if errorlevel 4 goto templ
if errorlevel 3 goto disp
if errorlevel 2 goto colour
goto exit
:colour
cls
d /Yny// /'This requires a couple of subdirectories to be created, Ok ?'
if not errorlevel 2 goto skip
md tempdir1
md tempdir2
:skip
echo This will offer a few samples of the many possible options for colour.
echo It will in each case sort names by file/dir "type" to improve the layout.
echo PocketD ran as: D /st
:col2
d /Y123/ /'//@tChoose://@t1. Limited colour/@t2. Link Colour to name/@t3. Link Colour to name and fields//@tESC cancel//@t?'
cls
if errorlevel 3 goto 3
if errorlevel 2 goto 2
if errorlevel 1 goto 1
d /ID tempdir? /zz@
d /Yn_y /'//@tDiscard last colour scheme selected for further demos ?'
if errorlevel 3 set d_col=
goto main
:1
echo This makes very limited use of colours to distinguish files from dirs etc..
set d_col=wWcW
echo Colours set by: SET D_COL=wWcW
d /r.0st/.d
echo .
pause
cls
goto col2
:2
echo This colours all fields associated with a file/dir with the selected colour
echo for that file/dir type or extension. Subdirs are shown as cyan and executable
echo files in bright red. This is overridden by colours selected for particular
echo extensions and filespecs.
set d_col=wwcR----:Y*del*:g.doc:g.gde:g.hlp:y.bat
echo Colours set by: SET D_COL=wwcR----:Y*del*:g.doc:g.gde:g.hlp:y.bat
d /r.0st/.d
echo .
pause
cls
goto col2
:3
echo This example also links colour to the file name, but colours the fields
echo "size" and "date" with their own colour.
set d_col=wwcRwKWyyWw:Y*del*:g.doc:g.gde:g.hlp:y.bat
echo Colours set by: SET D_COL=wwcRwKWyyWw:Y*del*:g.doc:g.gde:g.hlp:y.bat
d /r.0st/.d
echo .
pause
cls
goto col2
:disp
cls
d /Y1234 /'//@tChoose://@t1. Normal,@/w,@/m and @/t format/@t2. Bestfit/@t3. Subdir summary/@t4. Tailoring//@tESC cancel//@t?'
cls
if errorlevel 4 goto tail
if errorlevel 3 goto subdir
if errorlevel 2 goto bestfit
if errorlevel 1 goto wmt
goto main
:wmt
echo This is the default format: standard details sorted by file/dir name
echo D
d
echo .
pause
cls
echo This is the /w "wide" format giving only filename and size in KBytes
echo D /w
d /w
echo .
pause
cls
echo This is the /m "minimum" format giving only the filename
echo D /m
d /m
echo .
pause
cls
echo This is the /t "tiny" format grouping files by extension
echo D /t
d /t
echo .
pause
goto disp
:bestfit
echo This is the "Best-fit" format which automatically chooses the display format.
echo In this case /w format is chosen to fit the 80x11 format used by the demo.
echo D /b
d /b
echo .
pause
cls
echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
echo In this case the layout is altered to 3 columns which still fits inside 11 rows.
echo D /b/.k
d /b/.k
echo .
pause
goto disp
:subdir
echo This demonstrates some of the subdirectory summary features of PocketD
d /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
if not errorlevel 2 goto disp
echo D N*.BAT D*.BAT /cc TEMPDIR1 ( command used for copy/create )
d n*.bat d*.bat /cc tempdir1
echo .
md tempdir2
echo Subdirs TEMPDIR1 and TEMPDIR2 created
pause
cls
echo The following uses /r to include a summary of the contents of subdir TEMPDIR1
echo and TEMPDIR2
echo D /r
d /r
echo .
pause
cls
echo The following uses /S and /G to group contents of subdirs
echo D /wSG
d /wSG
echo .
pause
cls
d /Y// /'//Deleting temporary files.'
echo D tempdir1\ tempdir2\ /zd ( command used to delete )
d tempdir1\ tempdir2\ /Ihzd
echo .
pause
goto disp
:tail
echo PocketD offers 19 tailoring options. The following shows four of these:
echo 1. Unbroken names 2. 1jan91 date format 3. Lowercase 4. Sorting by row
echo D /.umlr
d /.umlr
echo .
pause
goto disp
:templ
cls
echo PocketD has a very powerful TEMPLATE facility that can be used for display
echo or execution purposes. It can accept 40 possible parameters, a few shown below.
d /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
cls
if errorlevel 2 goto t_exec
if errorlevel 1 goto t_disp
goto main
:t_disp
echo The display template can be used in many ways. The simple example at the
echo bottom of the screen simply outputs an X for each matching file/dir.
echo D /w
d /w
echo .
echo D [X]
d [X]
echo .
pause
cls
echo The template can accept parameters such as $f giving the filename
echo D [$f ]
d [$f ]
echo .
echo It can also accept formatted field widths e.g. $16f for padding to width 16
echo D [$16f]
d [$16f]
echo .
pause
cls
echo $10n gives only the name part without the extension, padded to width 10:
echo D [$10n]
d [$10n]
echo .
echo "//" in the template will add a newline:
echo D ?????.* [$10n//]
d ?????.* [$10n//]
echo .
pause
goto templ
:t_exec
echo PocketD can be used to run a template for a selected group of files. For
echo example, the following could be used to move each file extension group to
echo its own archive file:
echo (R? below causes PocketD to echo each line without running it. R runs).
echo D /e [PKZIP -m $e *.$e]R?
d /e [PKZIP -m $e *.$e]R?
echo .
pause
cls
echo PocketD can run multi-line sequences. e.g. To move each file extension
echo group to its own subdir, named by the extension:
echo D /e [md $e//copy *.$e $e]R?
D /e [md $e//copy *.$e $e]R?
echo .
pause
goto templ
:stats
cls
echo PocketD can provide additional information about files and present file
echo data in a number of ways. The following gives a few examples of this.
d /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size && Compression/@t3. Extension summary//@tESC cancel//@t?'
cls
if errorlevel 3 goto exten
if errorlevel 2 goto exec
if errorlevel 1 goto bar
goto main
:bar
echo The following chart show the relative size of all files represented as a
echo bar chart. *.BAT files are excluded to reduce the number of files displayed.
echo D /g- *.BAT
d /g- *.bat
echo .
pause
cls
echo The chart is improved by sorting the files by size (ss) & showing the relative
echo percentage usage of each (%%). It also shows the size in terms of space used
echo rather than actual size (U).
echo D /ss /%%U /g- *.BAT (or D /ss/%Ug- *.BAT etc..)
d /ss/%%Ug- *.bat
echo .
pause
goto stats
:exec
echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
echo Executable files can be compressed by PKLITE, DIET and LZEXE. The /C option
echo will show files that are compressed by flagging the attribute as p,d or l
echo D /EMC ( E=executable M=exec size C=Compress check )
d /EMC
echo .
pause
goto stats
:exten
echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
echo to assess the space used by each extension present.
echo D /e
d /eh.2
echo .
echo This could be used with other options to provide further information. e.g.
echo Showing only the top 4 extensions (in terms of size) and plotting a barchart.
echo D /eK.4g%%/ss (K.4 = 1st 4, /ss = sort by size, g = barchart)
d /eK.4g%%/ss/h.2
echo .
pause
goto stats
:select
cls
echo PocketD can apply many criteria for selecting files and subdirectories.
d /Y123 /'/@tChoose://@t1. Filespecs/@t2. Size/@t3. String searching//@tESC cancel//@t?'
cls
if errorlevel 3 goto string
if errorlevel 2 goto size
if errorlevel 1 goto filesp
goto main
:filesp
echo PocketD uses a generalised filespec system that can include and exclude names.
echo The following shows all executable files in the current directory:
echo D /mhE/.u ( m=minimum h=no header E=executable /.u=unbroken names )
d /mhE/.u
echo.
echo The group of files selected can be reduced using filespecs:
echo D /mhE/.u *L*A* E* ( Only names with an L followed later by A
echo or starting with the letter E )
d /mhE/.u *L*A* E*
echo .
echo The command line can also include "exclusion" filespecs:
echo D /mhE/.u *L*A* E* /- *D* ??L* ( also excluding all names containing D
echo or the letter L as the 3rd character)
d /mhE/.u *L*A* E* /- *D* ??L*
echo .
pause
cls
echo PocketD also allows "type" specifications in filenames, for example:
echo D *=D* *=n* /hm
d *=D* *=n* /hm
echo .
echo This uses "=D" to match any name containing a digit, and "=n" to match
echo any name that contains a non-alphanumeric character (uppercase indicates
echo match, lowercase for non-match). Also supported: =A/=a match alpha/non-alpha.
pause
goto select
:size
echo PocketD can select files by size (and also date, See D /??).
echo The following shows all non-executable files sorted by size:
echo D /h!Ess ( h=no header !E=NOT executable ss=sort by size )
d /h!Ess
echo .
echo A size restriction could be added to this:
echo D /h!Ess/}20000 ( greater or equal to 20000 )
D /h!Ess/}20000
echo .
echo This could be replaced by a range 20k to 50k (k=Kilobytes):
echo D /h!Ess/}20k{50k
D /h!Ess/}20k{50k
pause
goto select
:string
echo PocketD can select files by the strings they contain (m=minimum h=no header):
echo D *.BAT /mh'not' ( only *.BAT files containing 'not' )
d *.bat /mh'not'
echo .
echo This can be inverted to only those not containing 'not':
echo D *.BAT /mh!'not' ( !'not' = not including 'not' )
d *.BAT /mh!'not'
echo .
echo Extra options can be added to show 1st match found, but no dir listing:
echo D *.BAT /mh'not'Sd ( S = show strings d = no directory )
d *.BAT /mh'not'Sd
echo .
pause
cls
echo The string searching facility can be used to search for types of character,
echo for example: Numeric digit, Alphabetic, Alpha-numeric, space characters etc..
echo D *.BAT /hm'subdir'Sd ( files containing the string 'subdir' )
d *.bat /hm'subdir'Sd
echo .
echo This could be modified to find files with 'subdir' but not 'subdirectory':
echo D *.BAT /hm'subdir@a'Sd ( @a = non-alphabetic character )
d *.bat /hm'subdir@a'Sd
echo .
echo Other options include L/l show/don't show line numbers, * show all strings
echo and "" instead of '' for case-insensitive search.
pause
goto select
:help
cls
echo PocketD comes with a number of documentation files. This demo only gives access
echo to the on-line help. the remaining files can be read by typing the line:
echo "D FEATURE.CMP README.D /q" from the DOS prompt.
echo 1. The single page help, accessed by D /?
pause
d /?
pause>nul
cls
echo 2. The general documentation, assessed by D /?doc
pause
d /?doc
cls
echo 3. The User Guide, assessed by D /??
pause
d /??
cls
echo 4. The on-line manual, given for the example D /?e
d /?e
goto main
:exit
cls
echo DEMO terminated
echo This demonstration has not covered the following major features:
echo . COPY/MOVE facilities, including copy to multi-disk, conditional copy,
echo subtree copying and "safe" copy features.
echo . FILE SEARCH across multiple drives/subdirs
echo . ARCHIVE viewing and searching in ZIP/ARC/ZOO/LZH/ARJ/PAK archives
echo . Using PocketD to emulate utilities such as NCD, WHICH and MAKE etc..
echo . TOUCH and full ATTRIB modification of files
echo . ON-LINE FILE VIEWER in text or hex format
echo . ON-LINE BROWSE of file lists
echo . ENVIRONMENT VARIABLE analysis from command line. e.g. D :PATH
echo . The 37 USER-DEFINED parameter names
echo You are referred to the on-line guide accessed by typing D /?? for these.
set d_opt2=
if "%d_col%"=="" goto fin
d /Yn_y/ /'/Discard current colour scheme for use after DEMO ?'
if errorlevel 3 set d_col=
:fin